<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>模拟select</title>
    <script src="jquery-3.1.1.js"></script>
    <style>
    .d1{
        width: 150px;
        height: 30px;
        text-align: center;
        background-color: lightgreen;
        font-size: 20px;
    }
    .d2{
        width: 250px;
        /*border: 1px solid black;*/
    }
    div{
        float: left;
    }
    span{
        display: block;
        width: 250px;
        height: 30px;
        text-align: center;
        background-color: gray;
    }
    ul{
       display: none;
    }
    li{
        display: block;
        width: 250px;
        height: 30px;
        text-align: center;
        margin: 0;
        padding: 0;
        border-bottom: 1px dashed red;
    }
    li:hover{
        background-color: gray;
    }
    .u1{
        display: block;
        border: 1px solid red;
        margin: 0;
        padding: 0;
        width: 250px;
    }
    </style>
</head>
<body>
    <div class="d1">选择项目：</div>
    <div class="d2">
        <span>未选择</span>
        <ul>
        <li>html5</li>
        <li>css3</li>
        <li>JavaScript</li>
        <li>jQuery</li>
        </ul>
    </div>
    <div style="clear: both"></div>
</body>
</html>
    <script>
    
    $('span').mouseover(function(){
        $(this).siblings().addClass('u1');
    })
    $('li').click(function(){
        $('ul').removeClass('u1')
        $('span').html($(this).html())
    })
    
    
    
    
    </script>
    